package com.xiahui.day10.TestSuper.Test3;

class Animal {
    public void eat() {
        System.out.println("The animal is eating.");
    }
}

class Dog extends Animal {
    @Override
    public void eat() {
        System.out.println("The dog is eating dog food.");
    }

    public void parentEat() {
        super.eat(); // 调用父类的 eat() 方法
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.eat();       // 调用子类的 eat() 方法
        dog.parentEat(); // 调用父类的 eat() 方法
    }
}
